<%@ page import="com.ld.businesscard_manage.service.BusinessCardService" %>
<%@ page import="com.ld.businesscard_manage.service.impl.BusinessCardServiceImpl" %>
<%@ page import="com.ld.businesscard_manage.bean.BusinessCard" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 刘邓
  Date: 2023-06-11
  Time: 14:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用excel存储名片信息</title>
</head>
<body>
    <%!
        private BusinessCardService cardService = new BusinessCardServiceImpl();
    %>
<%
    try {
        List<BusinessCard> cards = cardService.getAllCards();
        cardService.exportAllCardsToExcel(cards);
        out.println("<h1>存储成功!</h1>");
        out.println("<a href='/home/manageCard.jsp' style='display: inline-block;width:30%,height: 30px;margin:10px 30px;text-align:center;line-height:30px;background-color:blue'>返回名片页面</a><br>");
    } catch (Exception e) {
        out.println("<h1>存储失败!");
    }


%>
</body>
</html>
